//引入项目中需要注册的全局组件
import {App} from "vue";
import Category from "../components/Category/index.vue"
import SvgIcon from "../components/SvgIcon/svgIconComponent.vue"; //svg全局组件
import * as ElementPlusIconsVue from "@element-plus/icons-vue" //引入elementPlus图标库

//需要注册的全局组件
const allGlobalcomponents = {"SvgIcon": SvgIcon, "Category": Category};

//对外暴露插件对象
export default {
    //务必叫install 方法
    install(app: App) {
        //遍历注册
        Object.keys(allGlobalcomponents).forEach(key => {
            //注册为全局组件
            //@ts-ignore
            app.component(key, allGlobalcomponents[key]);
        });
        //注册ElementPlus图标
        for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
            app.component(key, component)
        }


    }
}